/*    */ package cc.s2m.web.s2mBlog.init;
/*    */ 
/*    */ import cc.s2m.util.idsquence.SequenceUtils;
/*    */ import cc.s2m.web.s2mBlog.util.StaticProp;
/*    */ import java.text.SimpleDateFormat;
/*    */ import java.util.Date;
/*    */ import java.util.Map;
/*    */ import java.util.TimeZone;
/*    */ import javax.annotation.PostConstruct;
/*    */ import javax.sql.DataSource;
/*    */ import main.java.com.UpYun;
/*    */ import org.apache.logging.log4j.LogManager;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.beans.factory.config.MapFactoryBean;
/*    */ import org.springframework.stereotype.Component;
/*    */ 
/*    */ @Component
/*    */ public class InitWebApplication
/*    */ {
/* 22 */   private static final Logger LOGGER = LogManager.getLogger(InitWebApplication.class);
/*    */ 
/*    */   @Autowired
/*    */   private DataSource dataSource;
/*    */ 
/*    */   @Autowired
/*    */   private MapFactoryBean sysConfig;
/*    */ 
/* 31 */   @PostConstruct
/*    */   protected void initWeb() { SequenceUtils.setDataSource(this.dataSource);
/* 32 */     TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
/* 33 */     SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
/* 34 */     StaticProp.upYunPath = "s2m/" + format.format(new Date()) + "/";
/* 35 */     System.setProperty("org.freemarker.loggerLibrary", "none");
/*    */     try {
/* 37 */       StaticProp.sysConfig = (Map)this.sysConfig.getObject();
/* 38 */       StaticProp.upyun = new UpYun(StaticProp.getSysConfigString("upyun.bucketName"), StaticProp.getSysConfigString("upyun.userName"), StaticProp.getSysConfigString("upyun.password"));
/*    */ 
/* 42 */       StaticProp.upyun.setApiDomain("v0.api.upyun.com");
/*    */     } catch (Exception e) {
/* 44 */       LOGGER.error("读取sysConfig系统配置信息错误：", e);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.init.InitWebApplication
 * JD-Core Version:    0.6.1
 */